import {lsHttp} from "../utils/lshttp";

// 获取商家详情
export const getDetailsAPI = (detilsData) => {
    return lsHttp({
        url: '/api/shop/details',
        method: 'POST',
        data: detilsData
    }, false)
}
// 获取活动详情
export const getActivityDetailsAPI = (activityData) => {
    return lsHttp({
        url: '/api/shop/shopActivityDetail',
        method: 'POST',
        data: activityData
    }, false)
}
/**
 * 检查店铺活动是否为订单相关活动
 *
 * 该函数通过调用后端API来检查给定的店铺活动ID是否关联到订单活动
 * 主要用于在客户端进行活动类型判断，以决定后续的操作流程
 *
 * @param {string} shopActivityId - 店铺活动ID，用于标识特定的店铺活动
 * @returns {Promise} 返回一个Promise对象，包含API调用的结果
 */
export const checkActivityIsOrderAPI = (shopActivityId) => {
    return lsHttp({
        url: '/api/order/checkActivityIsOrder',
        method: 'POST',
        data: {
            shop_activity_id: shopActivityId,
        }
    })
}

// 获取红包卡券
export const redHotAPI = (shopId) => {
    return lsHttp({
        url: '/api/shop/getRedHot',
        method: 'POST',
        data: {
            shop_id: shopId,
        }
    })
}

// 套餐查看计数
export const getRecordViewCountAPI = (shopId) => {
    return lsHttp({
        url: '/api/shop/recordViewCount',
        method: 'POST',
        data: {
            shop_activity_id: shopId,
        }
    })
}

